package main

// 找到最长的连续递增的子序列
// 关键：连续

// dp[i] 下标i结尾的连续递增子序列长度

func findLengthOfLCIS(nums []int) int {
	if len(nums) == 0 {
		return 0
	}
	res := 1
	dp := make([]int, len(nums)+1)
	for i := range dp {
		dp[i] = 1
	}

	for i := 0; i < len(nums)-1; i++ {
		if nums[i+1] > nums[i] { // 连续记录
			dp[i+1] = dp[i] + 1
		}
		if dp[i+1] > res {
			res = dp[i+1]
		}
	}
	return res
}
